package com.cdtu.testdynamicdatasource.controller;

import com.cdtu.testdynamicdatasource.mapper.mysql.AccountMapper;
import com.cdtu.testdynamicdatasource.mapper.sqlserver.ClientRegMapper;
import com.cdtu.testdynamicdatasource.mapper.sqlserver.UserInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Mika
 * @date 2023/11/30 11:02
 **/
@RestController
public class MainController {
    @Autowired
    AccountMapper mysqlMapper;
    @Autowired
    ClientRegMapper sqlserverLocalMapper;
    @Autowired
    UserInfoMapper sqlserverRemoteMapper;
    @GetMapping("mysql")
    public String getAccountList() {
        return mysqlMapper.getAccountList().toString();
    }
    @GetMapping("sqlserver/dev")
    public String getClientRegList() {
        return sqlserverLocalMapper.getClientRegList().toString();
    }
    @GetMapping("sqlserver/prod")
    public String getUserInfoList() {
        return sqlserverRemoteMapper.getUserInfoList().toString();
    }
}
